package com.googlecode.jsimplemarket.model;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.Index;

/**
 *
 * @author alex
 */
@MappedSuperclass
public abstract class AbstractNomenclator extends AbstractEntitate implements
        INomenclator {

    /**
     *
     */
    private static final long serialVersionUID = -3566107141809458241L;
    private Date dataInceput;
    private Date dataSfarsit;
    private String cod;
    private String denumire;

    public AbstractNomenclator() {
        super();
    }

    public AbstractNomenclator(String cod) {
        super();
        this.cod = cod;
    }

    @Temporal(value = TemporalType.TIMESTAMP)
    @Index(name = "IDX_DATA_INCEPUT")
    @Column(name = "DATA_INCEPUT")
    @Override
    public Date getDataInceput() {
        return dataInceput;
        }

    @Override
    public void setDataInceput(Date dataInceput) {
        this.dataInceput = dataInceput;
    }

    @Temporal(value = TemporalType.TIMESTAMP)
    @Column(name = "DATA_SFARSIT")
    @Index(name = "IDX_DATA_SFARSIT")
    @Override
    public Date getDataSfarsit() {
        return dataSfarsit;
    }

    @Override
    public void setDataSfarsit(Date dataSfarsit) {
        this.dataSfarsit = dataSfarsit;
    }

    @Column(name = "COD", length = 10, unique = true, nullable = false)
    @Index(name = "IDX_COD")
    @Override
    public String getCod() {
        return cod;
    }

    @Override
    public void setCod(String cod) {
        this.cod = cod;
    }

    @Column(name = "DENUMIRE", length = 100, nullable = false)
    @Index(name = "IDX_DENUMIRE")
    @Override
    public String getDenumire() {
        return denumire;
    }

    @Override
    public void setDenumire(String denumire) {
        this.denumire = denumire;
    }
}
